package com.yc.sole.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yc.sole.common.enums.CommonState;
import jakarta.persistence.*;
import lombok.Data;

/**
 * 字典項对象
 *
 * @author yizuomin
 * @date 2023-03-26
 **/
@Data
@Entity
@Table(name = "sys_dict_item", indexes = {
        @Index(name = "idx_dict_id", columnList = "dictId")
})
@TableName(value = "sys_dict_item")
public class DictItem {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    /**
     * 字典id
     */
    @Column(columnDefinition = "BIGINT NOT NULL COMMENT '字典id'")
    private Long dictId;
    /**
     * 字典项编码
     */
    @Column(columnDefinition = "VARCHAR(50) NOT NULL COMMENT '字典项key'")
    private String itemKey;
    /**
     * 字典项名称
     */
    @Column(columnDefinition = "VARCHAR(55) NOT NULL COMMENT '字典项名称'")
    private String itemName;
    /**
     * 状态 0无效 1有效
     */
    @Column(columnDefinition = "TINYINT(1) NOT NULL COMMENT '状态 0无效 1有效'")
    private CommonState state;
    /**
     * 排序
     */
    @Column(columnDefinition = "INT NOT NULL COMMENT '排序'")
    private Integer sort;
}
